﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="StudyTime_1.quizMe"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    IsTabStop="false"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:StudyTime_1"
    xmlns:common="using:StudyTime_1.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">


    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <!--Background="#FF128425"-->
    <Grid Style="{StaticResource LayoutRootStyle}" Background="White">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="140*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid Grid.ColumnSpan="2" Background="#FF128425">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}" Margin="40,0,0,36" Background="White" BorderBrush="#FF128425" Foreground="#FF128425"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Text="Quiz Me" Style="{StaticResource PageHeaderTextStyle}" Margin="33,0,-3,46"/>
        </Grid>

        <Grid Margin="10,5,0,0" x:Name="buttonGrid" Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center" >
            <Button x:Name="check" Content="Check" HorizontalAlignment="Left" Height="75" Margin="929.5,468,0,0" VerticalAlignment="Top" Width="252" Background="#00FF0404" Click="check_Click" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" BorderBrush="#FF128425" Foreground="Black"  >
                <Button.RenderTransform>
                    <CompositeTransform SkewX="20"/>
                </Button.RenderTransform>
            </Button>
            <Button x:Name="next" Content="Next"  HorizontalAlignment="Left" Margin="945.2,535,0,0" VerticalAlignment="Top" Width="252"  Height="71" Click="next_Click" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" BorderBrush="#FF128425" Foreground="Black" >
                <Button.RenderTransform>
                    <CompositeTransform SkewX="-20" TranslateX="-15" TranslateY="7" />
                </Button.RenderTransform>
            </Button>
            <Button x:Name="last"  Content="Previous" HorizontalAlignment="Left" Margin="99.2,535,0,0" VerticalAlignment="Top" Width="252" Height="75" Click="last_Click" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" BorderBrush="#FF128425" Foreground="Black"  >
                <Button.RenderTransform>
                    <CompositeTransform SkewX="20" TranslateX="-15" TranslateY="7" />
                </Button.RenderTransform>
            </Button>
            <Button x:Name="reviewBut"  Content="" HorizontalAlignment="Left" Height="75" Margin="86.7,468,0,0" VerticalAlignment="Top" Width="252" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" Click="reviewBut_Click" BorderBrush="#FF128425" Foreground="Black"  >
                <Button.RenderTransform>
                    <CompositeTransform SkewX="-20"/>
                </Button.RenderTransform>
            </Button>
            <Button Content="Select Quiz" x:Name="selectCards" HorizontalAlignment="Left" Height="61" Margin="74,412,0,0" VerticalAlignment="Top" Width="143" RenderTransformOrigin="0.5,0.5"  Click="selection_Click" UseLayoutRounding="False" d:LayoutRounding="Auto" BorderBrush="#FF128425" Foreground="Black">
                <Button.RenderTransform>
                    <CompositeTransform SkewX="20"  TranslateX="15.421" TranslateY="-7.462"/>
                </Button.RenderTransform>
            </Button>

            <Border BorderBrush="White" BorderThickness="1" Height="439" HorizontalAlignment="Left" Margin="284,10,0,0" x:Name="border1" VerticalAlignment="Top" Width="691" CornerRadius="5">

                <ScrollViewer Margin="0,0,-19,0">
                    <TextBlock x:Name="questions" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Height="1448" Width="686" FontFamily="Segoe UI" FontSize="22" Foreground="#FF128425" Margin="2" />
                </ScrollViewer>

            </Border>

            <!--<TextBox x:Name="answer" HorizontalAlignment="Left" Height="65" Margin="1030.408,397.5,0,0"  VerticalAlignment="Top" Width="149.092" AcceptsReturn="True" IsSpellCheckEnabled="True" FontSize="24" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto">
                <TextBox.RenderTransform>
                    <CompositeTransform SkewX="-20"/>
                </TextBox.RenderTransform>
            </TextBox>-->
            <TextBlock x:Name="errorBox" HorizontalAlignment="Left" Height="85" Margin="927,-115,0,0" TextWrapping="Wrap"  VerticalAlignment="Top" Width="331" FontFamily="Segoe UI" FontSize="14" Foreground="Red" TextAlignment="Center"/>
            <TextBlock HorizontalAlignment="Left" Height="27" Margin="1021,364,0,0" TextWrapping="Wrap" Text="Answer" VerticalAlignment="Top" Width="121" FontSize="20" TextAlignment="Center"/>


            <Grid x:Name="popin">
                <Grid.Resources>
                    <Storyboard x:Name="popinSB">
                        <PopInThemeAnimation Storyboard.TargetName="popin" FromHorizontalOffset="500"/>
                    </Storyboard>
                    <Storyboard x:Name="popoutSB">
                        <PopOutThemeAnimation  Storyboard.TargetName="popin" />
                    </Storyboard>
                </Grid.Resources>
                <StackPanel Name="imgScroll" Visibility="Collapsed" Margin="291,14,290,182">
                    <Image x:Name="quizImage" HorizontalAlignment="Left" Height="408" VerticalAlignment="Top" Width="673" Stretch="Fill" Margin="3,14,0,163"/>
                </StackPanel>
            </Grid>


            <ComboBox  Name="answer" HorizontalAlignment="Left"  Height="43" Margin="998,406,0,0" VerticalAlignment="Top" Width="158" FontSize="18" BorderBrush="#FF128425" Foreground="Black"/>
            <Button Content="Image" x:Name="imagebttn" IsEnabled="False" HorizontalAlignment="Center" Height="50" Margin="505,520,493,0" VerticalAlignment="Top" Width="260" Click="imagebttn_Click" BorderBrush="#FF128425" Foreground="Black" />


        </Grid>

        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup x:Name="ApplicationViewStates">
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>

                <!-- The back button and title have different styles when snapped -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</common:LayoutAwarePage>
